﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LIMS.BLL
{
    public class StuProjectManager
    {
        private static LIMS.IDAL.IStuProject istuProject = DALFactory.DataAccess<LIMS.IDAL.IStuProject>.CreateObject();
        
        /// <summary>
        /// 根据指定学生班级ID，获取与之相关的实验ID列表
        /// </summary>
        /// <param name="classID">指定学生的班级ID</param>
        /// <returns>返回与该学生相关的实验ID列表</returns>
        private static List<Int32> GetProIDs(String classID)
        {
            return istuProject.FindProByClassID(classID);
        }

        public static List<Model.Projects> GetProects(String classID)
        {
            List<Model.Projects> projects = new List<Model.Projects>();
            GetProIDs(classID).ForEach(
                (id) =>
                {
                    Model.Projects proTmp = ProjectManager.SearchProjectByID(id);
                    projects.Add(proTmp);
                });
            return projects;
        }
    }
}
